﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/Core.Master"
    CodeBehind="StumbledLoans.aspx.cs" Inherits="Pap.Web.Modules.Loan.Views.StumbledLoans"
    meta:resourcekey="PageResource1" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ext:Store runat="server" ID="storeStumbledLoans" AutoLoad="True" IDMode="Legacy"
        meta:resourcekey="storeStumbledLoansResource1" SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="LoanID">
                <Fields>
                    <ext:RecordField Name="LoanID" />
                    <ext:RecordField Name="LoanNumber" />
                    <ext:RecordField Name="CustomerName" />
                    <ext:RecordField Name="NonPaidMonthsCount" />
                    <ext:RecordField Name="InstallmentsOriginalAmount" />
                    <ext:RecordField Name="InstallmentsInterestAmount" />
                    <ext:RecordField Name="TotalPenaltyAmount" />
                    <ext:RecordField Name="Total" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Direction="ASC"></SortInfo>
    </ext:Store>
    <ext:FitLayout runat="server" IDMode="Legacy" meta:resourcekey="FitLayoutResource1">
        <ext:Panel runat="server" AutoScroll="true" Title="<%$Resources:StumbledPeople %>"
            meta:resourcekey="PanelResource1">
            <Body>
                <ext:GridPanel runat="server" ID="gridStumbledLoans" AutoHeight="True" StoreID="storeStumbledLoans"
                    meta:resourcekey="gridStumbledLoansResource1" AutoExpandColumn="CmdColumn">
                    <ColumnModel>
                        <Columns>
                            <ext:Column DataIndex="LoanNumber" Header="<%$ Resources:HeaderLoanNumber %>" Sortable="True" />
                            <ext:Column DataIndex="CustomerName" Header="<%$ Resources:HeaderCustomerName %>"
                                Sortable="True" />
                            <ext:Column DataIndex="NonPaidMonthsCount" Header="<%$ Resources:HeaderNonPaidMonthsCount %>" />
                            <ext:Column DataIndex="InstallmentsOriginalAmount" Header="<%$ Resources:HeaderInstallmentsOriginalAmount %>" />
                            <ext:Column DataIndex="InstallmentsInterestAmount" Header="<%$ Resources:HeaderInstallmentsInterestAmount %>" />
                            <ext:Column DataIndex="TotalPenaltyAmount" Header="<%$ Resources:HeaderTotalPenaltyAmount %>" />
                            <ext:Column DataIndex="Total" Header="<%$ Resources:HeaderTotal %>" Sortable="True" />
                            <ext:CommandColumn ColumnID="CmdColumn" Hideable="False" Sortable="True">
                                <Commands>
                                    <ext:GridCommand Text="<%$ Resources:Prosecute %>" CommandName="Prosecute" />
                                    <ext:GridCommand Text="<%$ Resources:Reschedule %>" CommandName="Reschedule" />
                                    <ext:GridCommand Text="<%$ Resources:Exempt %>" CommandName="Exempt" />
                                    <ext:GridCommand Text="<%$ Resources:CancelDebts %>" CommandName="CancelDebts" />
                                </Commands>
                            </ext:CommandColumn>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel runat="server" SingleSelect="true" />
                    </SelectionModel>
                    <AjaxEvents>
                        <Command OnEvent="StumbledLoans_Command">
                            <ExtraParams>
                                <ext:Parameter Name="Command" Value="command" Mode="Raw" Encode="False" />
                                <ext:Parameter Name="LoanID" Value="record.data.LoanID" Mode="Raw" Encode="False" />
                            </ExtraParams>
                        </Command>
                    </AjaxEvents>
                </ext:GridPanel>
            </Body>
        </ext:Panel>
    </ext:FitLayout>
    <ext:Window runat="server" ID="wndPenaltyFree" AutoScroll="true" Modal="true" ShowOnLoad="false"
        Width="350" Height="150">
        <Body>
            <ext:FitLayout ID="FitLayout1" runat="server">
                <ext:FormPanel runat="server" ID="panelWnd" IDMode="Static" AutoHeight="true">
                    <Body>
                        <ext:FormLayout ID="FormLayout1" runat="server">
                            <ext:Anchor>
                                <ext:TextField runat="server" ID="txtAllDebts" Disabled="true" meta:resourcekey="AllDebtsField" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:TextField runat="server" ID="txtPenalties" Disabled="true" meta:resourcekey="PenaltiesField" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:NumberField runat="server" ID="txtNumPaymentAmount" 
                                    AllowNegative="true" MinValue="1" AllowBlank="false" meta:resourcekey="PaymentAmountField"/>
                            </ext:Anchor>
                        </ext:FormLayout>
                    </Body>
                    <BottomBar>
                        <ext:StatusBar runat="server">
                            <Items>
                                <ext:Button runat="server" ID="btnFreePenalties" Text="PayDebts" Icon="Money">
                                    <AjaxEvents>
                                        <Click OnEvent="BtnFreePenalties_Clicked" Before="return Ext.getCmp('panelWnd').getForm().isValid();">
                                            <Confirmation ConfirmRequest="true" Message="r u sure" Title="confrm" BeforeConfirm="return Ext.getCmp('panelWnd').getForm().isValid();" />
                                        </Click>
                                    </AjaxEvents>
                                </ext:Button>
                            </Items>
                        </ext:StatusBar>
                    </BottomBar>
                </ext:FormPanel>
            </ext:FitLayout>
        </Body>
    </ext:Window>
    
</asp:Content>
